<?php

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

/**
 * App\Models\User
 *
 * @property int $user_id
 * @property string $email
 * @property string $user_name
 * @property string $password
 * @property string $question
 * @property string $answer
 * @property int $sex
 * @property string $birthday
 * @property string $user_money
 * @property string $frozen_money
 * @property int $pay_points
 * @property int $rank_points
 * @property int $address_id
 * @property int $reg_time
 * @property int $last_login
 * @property string|null $last_time
 * @property string $last_ip
 * @property int $visit_count
 * @property int $user_rank
 * @property int $is_special
 * @property string|null $ec_salt
 * @property string $salt
 * @property int $parent_id
 * @property int $flag
 * @property string $alias
 * @property string $msn
 * @property string $qq
 * @property string $office_phone
 * @property string $home_phone
 * @property string $mobile_phone
 * @property int $is_validated
 * @property string $credit_line
 * @property string|null $passwd_question
 * @property string|null $passwd_answer
 * @property string|null $platform
 * @property string|null $openid
 * @property string|null $openid_h5 H5的openid
 * @property string|null $openid_mp
 * @property int $user_type
 * @property string|null $user_pic 用户头像
 * @property string|null $recode 会员邀请码
 * @property string|null $unionid 不同平台的下微信登录标式
 * @property string|null $chartcode 图形验证码
 * @property string|null $nickname 微信小程序名称
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \Illuminate\Notifications\DatabaseNotificationCollection<int, \Illuminate\Notifications\DatabaseNotification> $notifications
 * @property-read int|null $notifications_count
 * @method static \Database\Factories\UserFactory factory(...$parameters)
 * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|User query()
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAddressId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAlias($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAnswer($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereBirthday($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereChartcode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereCreditLine($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereEcSalt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereEmail($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereFlag($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereFrozenMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereHomePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereIsSpecial($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereIsValidated($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereLastIp($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereLastLogin($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereLastTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereMobilePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereMsn($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereOfficePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereOpenid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereOpenidH5($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereOpenidMp($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereParentId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePasswdAnswer($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePasswdQuestion($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePassword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePayPoints($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePlatform($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereQq($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereQuestion($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereRankPoints($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereRecode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereRegTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereSalt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereSex($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUnionid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUserMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUserName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUserPic($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUserRank($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUserType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereVisitCount($value)
 * @mixin \Eloquent
 */
class User extends Authenticatable
{
    use HasFactory, Notifiable;

    protected $table = 'users';
    protected $primaryKey = 'user_id';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id', 'email', 'user_name', 'password', 'question', 'answer', 'sex', 'birthday',
        'user_money', 'frozen_money', 'pay_points', 'rank_points', 'address_id', 'reg_time',
        'last_login', 'last_time', 'last_ip', 'visit_count', 'user_rank', 'is_special',
        'ec_salt', 'salt', 'parent_id', 'flag', 'alias', 'msn', 'qq', 'office_phone',
        'home_phone', 'mobile_phone', 'is_validated', 'credit_line', 'passwd_question',
        'passwd_answer', 'platform', 'openid', 'openid_h5', 'openid_mp', 'user_type',
        'user_pic', 'recode', 'unionid', 'chartcode', 'nickname'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
        'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}
